Skip to content

feat: Real Apple TV (tvOS) automation: CoreDevice identity, agent lifecycle, tunnel transport#299

Open
setoelkahfi wants to merge 6 commits into
mobile-next:mainfrom
setoelkahfi:feature/ios-wireless-coredevice
Open

feat: Real Apple TV (tvOS) automation: CoreDevice identity, agent lifecycle, tunnel transport#299
setoelkahfi wants to merge 6 commits into
mobile-next:mainfrom
setoelkahfi:feature/ios-wireless-coredevice

Conversation

@setoelkahfi

@setoelkahfi setoelkahfi commented Jul 15, 2026

Copy link
Copy Markdown

Summary

#292 <- this.

Adds real Apple TV (tvOS) automation support to mobilecli so a physical Apple TV discovered over CoreDevice can be driven end to end — device discovery, app lifecycle, agent install/lifecycle, accessibility dumps, screenshots, and Siri Remote input — without falling back to go-ios (device not found) or screenshot-guessed navigation.

This is part of a three-repo upstream change across mobile-next/mobilecli, mobile-next/devicekit-ios, and mobile-next/mobile-mcp.

What's in this PR

  • CoreDevice identity + app-op parity for real Apple TV.
  • agent install --agent-path <ipa> for locally built runners while preserving release-download install.
  • Cached signed runner + generated .xctestrun for tvOS XCTest lifecycle.
  • Direct tunnel-IP transport to DeviceKit; no LAN exposure and no go-ios forwarding for CoreDevice-only Apple TV.
  • Siri Remote button gating and mobilecli io focus passthrough to device.io.focus.
  • Device-free unit coverage for identity retention, dispatch, agent-path override, cache keying, button gating, and terminate PID resolution.

Validation

  • go build ./...
  • go test ./... -race
  • gofmt clean

Physical Bedroom Apple TV E2E is tracked in the workspace PR; it is pending the device being online/paired.

Implements: SPECS/quality/real-tvos-device-support/SPEC.md

Related PRs

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f03a611d-38c0-4b28-8bd3-d2245e511165

📥 Commits

Reviewing files that changed from the base of the PR and between 463f2dd and 5270807.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (24)
  • cli/agent.go
  • cli/agent_test.go
  • cli/flags.go
  • cli/io.go
  • commands/focus.go
  • commands/info.go
  • commands/screenshot.go
  • devices/common.go
  • devices/ios.go
  • devices/ios_coredevice.go
  • devices/ios_coredevice_test.go
  • devices/ios_platform_test.go
  • devices/simulator.go
  • devices/tvos_agent.go
  • devices/tvos_agent_test.go
  • devices/wda/focus.go
  • devices/wda/press-button.go
  • devices/wda/press-button_test.go
  • devices/wda/source.go
  • go.mod
  • server/dispatch.go
  • server/server.go
  • utils/resign.go
  • utils/zipfile.go
 _______________________________
< The only circle I like is CI. >
 -------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@setoelkahfi

setoelkahfi commented Jul 15, 2026

Copy link
Copy Markdown
Author

tvOS device Living Room validation update:

  • Tested physical Apple TV Living Room, UDID 00008110-000260A4016A201E, tvOS 26.6.
  • Found and pushed df243b9: tolerate per-device go-ios info failures so CoreDevice-only Apple TVs still appear in mobilecli devices.
  • Validation passed: go test ./devices ./commands ./cli and go build ./...
  • CoreDevice app list, device info, screenshot, and Viaplay launch work.
  • Runner install is blocked by provisioning only: current Test_Runner_TV.mobileprovision does not include Living Room, and tvOS rejects it with 0xe8008012.

setoelkahfi and others added 6 commits July 15, 2026 15:02
mobilecli can now list and drive tvOS simulators, not just iOS ones.

- Recognise tvOS runtimes when parsing the simulator runtime string and
  report the `tvos` platform. Version parsing now also handles tvOS,
  watchOS, and xrOS.
- Pick the DeviceKit runner bundle id and process name based on the
  platform, so the `devicekit-tvosUITests` runner is found on tvOS.
- Install the arm64 tvOS runner artifact during agent install, with its
  own version and checksum entries.
- Map the tvOS Siri Remote buttons (UP, DOWN, LEFT, RIGHT, SELECT, MENU,
  PLAY_PAUSE) in the WDA press-button client.
- Include tvOS devices when resolving device model metadata.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Real Apple TV units are discovered over the same go-ios path as iPhones and
iPads, so detect them by product type (AppleTV*) and report platform tvos.
Route real tvOS devices through a shared installResignedRunner helper that
downloads devicekit-tvos-runner.ipa and re-signs it with the provisioning
profile, and suffix-match the tvOS runner bundle id so the re-signed,
team-prefixed id is recognised. Add unit tests for platform detection and
agent matching.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Milestones 1-3 for real Apple TV automation:

M1 - Retain both device identifiers (public hardware UDID +
CoreDevice identifier) on IOSDevice; derive tvOS state from CoreDevice
boot/tunnel state; add CoreDevice branches for terminate/install/
uninstall/openURL so real Apple TV app ops no longer hit go-ios
'device not found'.

M2 - Add 'agent install --agent-path <ipa>' to sideload a locally built
runner (skips download + pinned checksum, keeps re-sign + install); cache
the signed runner and a generated .xctestrun under the app cache, bound
to the device. Release path stays checksum-verified.

M3 - Start the tvOS runner via 'xcodebuild test-without-building' with the
cached .xctestrun and talk to the DeviceKit server directly over the
CoreDevice tunnel IP (net.JoinHostPort, never LAN/0.0.0.0). Reuse healthy
sessions, restart stale ones, own+clean up the child process on shutdown.
Per-platform Siri Remote button gating; tvOS dump ui retains focusable
element types.

Also add 'mobilecli io focus' (device.io.focus RPC passthrough) for
accessibility-identity focus, and device-free unit tests for identity
retention, platform/state dispatch, artifact override, cache keying,
button gating, and terminate PID resolution.

Implements: SPECS/quality/real-tvos-device-support/SPEC.md (Milestones 1-3, 6)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
A stale or unpaired go-ios record can fail device-info lookup before CoreDevice-only Apple TVs are appended. Log and skip the bad go-ios entry so CoreDevice discovery can still surface real tvOS devices such as Living Room.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the Xcode 26 tvOS XCTest environment and patch the generated xctestrun with the current CoreDevice tunnel listen host before launch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@setoelkahfi
setoelkahfi force-pushed the feature/ios-wireless-coredevice branch from 3e5e142 to 5270807 Compare July 15, 2026 13:03
@setoelkahfi
setoelkahfi marked this pull request as ready for review July 15, 2026 13:34
@setoelkahfi setoelkahfi changed the title Real Apple TV (tvOS) automation: CoreDevice identity, agent lifecycle, tunnel transport feat: Real Apple TV (tvOS) automation: CoreDevice identity, agent lifecycle, tunnel transport Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant